/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hd2tecnologia.telas;

import com.hd2tecnologia.auth.Auth;
import com.hd2tecnologia.entidades.Usuario;
import com.hd2tecnologia.mensagens.ShowMensagens;
import com.hd2tecnologia.utilidades.Icones;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.swing.UIManager;

/**
 *
 * @author Dulcyelliton Silva
 */
public class PrincipalTela extends javax.swing.JFrame {

    public static PrincipalTela instance;
    ShowMensagens print = new ShowMensagens();
    Icones icone = new Icones();
    Login visaoLogin = Login.getInstance();
    private static String usuarioLogado;
    
    public PrincipalTela() {
       visaoLogin.dispose();
       try {  
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 
        } catch (Exception e) {  
            e.printStackTrace();  
        }
        initComponents();
        inicializar();
    }
    
    public void inicializar(){
        this.setExtendedState(this.MAXIMIZED_BOTH);  
        checkUser();
        SimpleDateFormat data = new SimpleDateFormat("dd/MM/yyyy"); 
        txt_DataDoSistema.setText(data.format(Calendar.getInstance().getTime()));;
        setUsuario();
    }
    
    
    public void checkUser(){
        Auth auth = Auth.getInstance();
        Usuario usuario = Usuario.getInstance();
        
        txt_UsuarioDoSistema.setText(usuario.getLogin());
        
        if(auth.getNivel() == 2){
            menu_CadastroProduto.setEnabled(false);
            menu_CadastroCliente.setEnabled(false);
            menu_CadastroUsuario.setEnabled(false);
            menu_CadastroFornecedor.setEnabled(false);
            btn_CadastroCliente.setEnabled(false);
            btn_CadastrarFornecedor.setEnabled(false);
            btn_CadastroProduto.setEnabled(false);
            btn_Suporte.setEnabled(false);
            btn_CadastrarEmpresa.setEnabled(false);
            btn_EditarEmpresa.setEnabled(false);
        }
    }
    
    public void setUsuario() {
        Usuario instanciaUsuario = Usuario.getInstance();
        System.out.println(instanciaUsuario.getTipo());
        if(instanciaUsuario.getTipo() == 1){
            txt_UsuarioDoSistema.setText("Administrador: " +instanciaUsuario.getLogin());
        }else{
            txt_UsuarioDoSistema.setText("Usuário: " +instanciaUsuario.getLogin());
        }
            
    }     
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        btn_CadastroCliente = new javax.swing.JButton();
        btn_CadastrarFornecedor = new javax.swing.JButton();
        btn_CadastroProduto = new javax.swing.JButton();
        btn_RegistrarVenda = new javax.swing.JButton();
        btn_ConsutarVenda = new javax.swing.JButton();
        btn_Suporte = new javax.swing.JButton();
        btn_SairSistema = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        txt_UsuarioDoSistema = new javax.swing.JTextField();
        txt_DataDoSistema = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        txt_VersaoDoSistema = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbl_Empresa = new javax.swing.JTable();
        jPanel5 = new javax.swing.JPanel();
        btn_CadastrarEmpresa = new javax.swing.JButton();
        btn_EditarEmpresa = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnuCadastros = new javax.swing.JMenu();
        menu_CadastroCliente = new javax.swing.JMenuItem();
        menu_CadastroFornecedor = new javax.swing.JMenuItem();
        menu_CadastroProduto = new javax.swing.JMenuItem();
        mnuVendas = new javax.swing.JMenu();
        mnuItemRegistraVenda = new javax.swing.JMenuItem();
        mnuItemConsultaVenda = new javax.swing.JMenuItem();
        mnuAjuda = new javax.swing.JMenu();
        mnuItemSobre = new javax.swing.JMenuItem();
        mnuSistema = new javax.swing.JMenu();
        menu_CadastroUsuario = new javax.swing.JMenuItem();
        mnuItemSair = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("DSControl - Sistema de Gestão de Comércio");
        setExtendedState(MAXIMIZED_BOTH);
        setResizable(false);

        jPanel2.setLayout(new java.awt.GridLayout(1, 7));

        btn_CadastroCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/cadastro_clientes.png"))); // NOI18N
        btn_CadastroCliente.setText("Clientes");
        btn_CadastroCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CadastroClienteActionPerformed(evt);
            }
        });
        jPanel2.add(btn_CadastroCliente);

        btn_CadastrarFornecedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/cadastro_fornecedor.png"))); // NOI18N
        btn_CadastrarFornecedor.setText("Fornecedores");
        btn_CadastrarFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CadastrarFornecedorActionPerformed(evt);
            }
        });
        jPanel2.add(btn_CadastrarFornecedor);

        btn_CadastroProduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/cadaastr0_produtos.png"))); // NOI18N
        btn_CadastroProduto.setText("Produtos");
        jPanel2.add(btn_CadastroProduto);

        btn_RegistrarVenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/registrarVendas.png"))); // NOI18N
        btn_RegistrarVenda.setText("Registrar Vendas");
        btn_RegistrarVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_RegistrarVendaActionPerformed(evt);
            }
        });
        jPanel2.add(btn_RegistrarVenda);

        btn_ConsutarVenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/consultarVendas.png"))); // NOI18N
        btn_ConsutarVenda.setText("Consultar Vendas");
        jPanel2.add(btn_ConsutarVenda);

        btn_Suporte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/Suporte.png"))); // NOI18N
        btn_Suporte.setText("Suporte");
        btn_Suporte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SuporteActionPerformed(evt);
            }
        });
        jPanel2.add(btn_Suporte);

        btn_SairSistema.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/sair.png"))); // NOI18N
        btn_SairSistema.setText("Sair do Sistema");
        btn_SairSistema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SairSistemaActionPerformed(evt);
            }
        });
        jPanel2.add(btn_SairSistema);

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setText("Usuário logado:");

        txt_UsuarioDoSistema.setFont(new java.awt.Font("Microsoft YaHei", 1, 12));
        txt_UsuarioDoSistema.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txt_UsuarioDoSistema.setEnabled(false);

        txt_DataDoSistema.setFont(new java.awt.Font("Microsoft YaHei", 1, 12));
        txt_DataDoSistema.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txt_DataDoSistema.setEnabled(false);

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel4.setText("Versão do Sistema:");

        txt_VersaoDoSistema.setFont(new java.awt.Font("Microsoft YaHei", 1, 12));
        txt_VersaoDoSistema.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txt_VersaoDoSistema.setEnabled(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addGap(10, 10, 10)
                .addComponent(txt_UsuarioDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 488, Short.MAX_VALUE)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txt_VersaoDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_DataDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_UsuarioDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel4)
                    .addComponent(txt_VersaoDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_DataDoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {txt_DataDoSistema, txt_UsuarioDoSistema, txt_VersaoDoSistema});

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/hd2tecnologia/icones/fundo_principal3.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 1232, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 564, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel4.setLayout(new java.awt.GridLayout(1, 0));

        tbl_Empresa.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nome", "CNPJ / CPF", "Telefone 1", "Telefone 2"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tbl_Empresa);
        tbl_Empresa.getColumnModel().getColumn(1).setMinWidth(170);
        tbl_Empresa.getColumnModel().getColumn(1).setMaxWidth(170);
        tbl_Empresa.getColumnModel().getColumn(2).setMinWidth(170);
        tbl_Empresa.getColumnModel().getColumn(2).setMaxWidth(170);
        tbl_Empresa.getColumnModel().getColumn(3).setMinWidth(170);
        tbl_Empresa.getColumnModel().getColumn(3).setMaxWidth(170);

        jPanel4.add(jScrollPane1);

        jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel5.setLayout(new java.awt.GridLayout(2, 0, 5, 5));

        btn_CadastrarEmpresa.setText("Cadastrar");
        jPanel5.add(btn_CadastrarEmpresa);

        btn_EditarEmpresa.setText("Editar");
        jPanel5.add(btn_EditarEmpresa);

        mnuCadastros.setText("Cadastro");

        menu_CadastroCliente.setText("Cliente");
        menu_CadastroCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_CadastroClienteActionPerformed(evt);
            }
        });
        mnuCadastros.add(menu_CadastroCliente);

        menu_CadastroFornecedor.setText("Fornecedor");
        menu_CadastroFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_CadastroFornecedorActionPerformed(evt);
            }
        });
        mnuCadastros.add(menu_CadastroFornecedor);

        menu_CadastroProduto.setText("Produto");
        menu_CadastroProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_CadastroProdutoActionPerformed(evt);
            }
        });
        mnuCadastros.add(menu_CadastroProduto);

        jMenuBar1.add(mnuCadastros);

        mnuVendas.setText("Vendas");

        mnuItemRegistraVenda.setText("Registrar Venda");
        mnuItemRegistraVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemRegistraVendaActionPerformed(evt);
            }
        });
        mnuVendas.add(mnuItemRegistraVenda);

        mnuItemConsultaVenda.setText("Consultar Venda");
        mnuItemConsultaVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemConsultaVendaActionPerformed(evt);
            }
        });
        mnuVendas.add(mnuItemConsultaVenda);

        jMenuBar1.add(mnuVendas);

        mnuAjuda.setText("Ajuda");

        mnuItemSobre.setText("Sobre");
        mnuItemSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemSobreActionPerformed(evt);
            }
        });
        mnuAjuda.add(mnuItemSobre);

        jMenuBar1.add(mnuAjuda);

        mnuSistema.setText("Sistema");

        menu_CadastroUsuario.setText("Usuários do Sistema");
        menu_CadastroUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_CadastroUsuarioActionPerformed(evt);
            }
        });
        mnuSistema.add(menu_CadastroUsuario);

        mnuItemSair.setText("Sair");
        mnuItemSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemSairActionPerformed(evt);
            }
        });
        mnuSistema.add(mnuItemSair);

        jMenuBar1.add(mnuSistema);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 1121, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 1232, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void menu_CadastroClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_CadastroClienteActionPerformed
        ClienteTela cliente = ClienteTela.getInstance();
        cliente.setVisible(true);
    }//GEN-LAST:event_menu_CadastroClienteActionPerformed

    private void menu_CadastroFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_CadastroFornecedorActionPerformed
        FornecedorTela FornecedorVisao = FornecedorTela.getInstance();
        FornecedorVisao.setVisible(true);
   }//GEN-LAST:event_menu_CadastroFornecedorActionPerformed

    private void menu_CadastroProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_CadastroProdutoActionPerformed

   }//GEN-LAST:event_menu_CadastroProdutoActionPerformed

    private void mnuItemRegistraVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemRegistraVendaActionPerformed

   }//GEN-LAST:event_mnuItemRegistraVendaActionPerformed

    private void mnuItemConsultaVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemConsultaVendaActionPerformed

   }//GEN-LAST:event_mnuItemConsultaVendaActionPerformed

    private void mnuItemSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemSobreActionPerformed
        Contato contato = Contato.getInstance();
        contato.setVisible(true);
    }//GEN-LAST:event_mnuItemSobreActionPerformed

    private void mnuItemSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemSairActionPerformed
       boolean confirm = print.confirmarMensagem("Deseja sair do DSControl?", "Fechar DSControl", icone.getSAIR());
    
    if (confirm) {
        System.exit(0);
    }
    }//GEN-LAST:event_mnuItemSairActionPerformed

    private void btn_CadastroClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CadastroClienteActionPerformed
        ClienteTela clienteTela = ClienteTela.getInstance();
        clienteTela.setVisible(true);
    }//GEN-LAST:event_btn_CadastroClienteActionPerformed

    private void btn_SuporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SuporteActionPerformed
        Contato contato = Contato.getInstance();
        contato.setVisible(true);
        //JOptionPane.showMessageDialog(this, "HD2 Tecnologia - Soluções de Qualidade!", "Informação", JOptionPane.INFORMATION_MESSAGE);
    }//GEN-LAST:event_btn_SuporteActionPerformed

    private void btn_SairSistemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SairSistemaActionPerformed
       boolean confirm = print.confirmarMensagem("Deseja sair do DSControl?", "Fechar DSControl", icone.getSAIR());
    
    if (confirm) {
        System.exit(0);
    }
        
    }//GEN-LAST:event_btn_SairSistemaActionPerformed

    private void btn_CadastrarFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CadastrarFornecedorActionPerformed
       FornecedorTela FornecedorVisao = FornecedorTela.getInstance();
       FornecedorVisao.setVisible(true);
    }//GEN-LAST:event_btn_CadastrarFornecedorActionPerformed

    private void menu_CadastroUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_CadastroUsuarioActionPerformed
        UsuarioTela visao = UsuarioTela.getInstance();
        visao.setVisible(true);
    }//GEN-LAST:event_menu_CadastroUsuarioActionPerformed

    private void btn_RegistrarVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_RegistrarVendaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btn_RegistrarVendaActionPerformed

   /*
    public static void main(String args[]){
        PrincipalTela visaoPrincipal = new PrincipalTela();
        visaoPrincipal.setVisible(true);
    }*/
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_CadastrarEmpresa;
    private javax.swing.JButton btn_CadastrarFornecedor;
    private javax.swing.JButton btn_CadastroCliente;
    private javax.swing.JButton btn_CadastroProduto;
    private javax.swing.JButton btn_ConsutarVenda;
    private javax.swing.JButton btn_EditarEmpresa;
    private javax.swing.JButton btn_RegistrarVenda;
    private javax.swing.JButton btn_SairSistema;
    private javax.swing.JButton btn_Suporte;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenuItem menu_CadastroCliente;
    private javax.swing.JMenuItem menu_CadastroFornecedor;
    private javax.swing.JMenuItem menu_CadastroProduto;
    private javax.swing.JMenuItem menu_CadastroUsuario;
    private javax.swing.JMenu mnuAjuda;
    private javax.swing.JMenu mnuCadastros;
    private javax.swing.JMenuItem mnuItemConsultaVenda;
    private javax.swing.JMenuItem mnuItemRegistraVenda;
    private javax.swing.JMenuItem mnuItemSair;
    private javax.swing.JMenuItem mnuItemSobre;
    private javax.swing.JMenu mnuSistema;
    private javax.swing.JMenu mnuVendas;
    private javax.swing.JTable tbl_Empresa;
    private javax.swing.JTextField txt_DataDoSistema;
    private javax.swing.JTextField txt_UsuarioDoSistema;
    private javax.swing.JTextField txt_VersaoDoSistema;
    // End of variables declaration//GEN-END:variables


    public static PrincipalTela getInstance(){
        if(instance == null){
            instance = new PrincipalTela();
        }
        return instance;
    }
    
    public void kilInstance(){
        instance = null;
    }
    
}
